﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTOSingTowerMall;

namespace BLSingTowerMall
{
    public class OrganiserEventsBookingsProcess
    {
        private DBSingTowerMallEntities cntx = new DBSingTowerMallEntities();
        //IQueryable<IEventHallBooking>
        public IQueryable<EventsBookingHistory> getOrganiserEventsBookings(string userName)
        {
            IQueryable<EventsBookingHistory> eventsbookings = from s in cntx.EventHallBookings
                                 where s.UserName == userName
                                 //select s;
                                 select new EventsBookingHistory 
                                 {BookingID=s.BookingID,
                                  HallID = s.HallID,
                                  EventStartDateTime = s.EventStartDateTime,
                                  EventEndDateTime =s.EventEndDateTime,
                                  EventTitle = s.EventTitle,
                                  ApprovalDateTime = s.ApprovalDateTime,
                                  TotalPrice = s.TotalPrice,
                                  Status = s.Status
                                  } ;//(i => new {i. });


            return eventsbookings;
        }
    }
}
